<!--js date picker-->
<link href="<?php echo base_url(); ?>./css/css_datepicker/jquery.ui.all.css" rel="stylesheet" type="text/css" />  
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.widget.js"></script>

<!--end js date picker-->
<script language="javascript" type="text/javascript">
    $(function() {
        $( ".datepicker" ).datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'yy:mm:dd' 
        });
    });
           
</script>
<style type="text/css">
    .task1 p{ color: red;font-size: 12px;}
    .task1 span{color:red;}
</style>
<div class="task1">
    <?php
    //--------------this is using condition for define about validation session message----------------

    if ($this->session->userdata('ms_error')) {
        echo message($this->session->userdata('ms_error'), "error");
        $this->session->unset_userdata("ms_error");
    }

    //-------------this is  the end of function  for validation session message-----------------------

    echo form_open('attendance/add');
    echo '<div class="form-wrapper">';
    echo '<fieldset style="margin: 0 auto;width:93%;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
    echo '<legend align="center"><div class="heading" style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 20px;">Add New Attendance</div></legend>';
    echo '<div style="float: right; border: 0px #ccc solid;">';
    echo anchor('attendance/manager', img('images/user_images/cancel.png'));
    echo '</div>';
    echo '<table  align="center" width="auto">';

//student name
    echo '<tr>';
    $selectdata = $this->db->get('tbl_student');
    $select[''] = '----Select student-- --';
    foreach ($selectdata->result() as $row) {
        $select[$row->stu_id] = $row->stu_name;
    }
    echo '<td>Student Name<span>*</span></td>';
    echo '<td>';
    echo form_dropdown("student_name", $select, $this->input->post("student_name") ? $this->input->post("student_name") : " ");
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    $selectTeacher = $this->db->get('tbl_teacher');
    $teacherRow[''] = '----Select teacher----';
    foreach ($selectTeacher->result() as $row) {
        $teacherRow[$row->tea_id] = $row->tea_name;
    }
    echo '<td>Teacher Name<span>*</span></td>';
    echo '<td>';
    echo form_dropdown("teacher_name", $teacherRow, $this->input->post("teacher_name") ? $this->input->post("teacher_name") : " ");
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    $selectClass= $this->db->get('tbl_class');
    $classRow[' '] = '----Select class----';
    foreach ($selectClass->result() as $row) {
        $classRow[$row->cla_id] = $row->cla_name;
    }
    echo '<td>Class Name<span>*</span></td>';
    echo '<td>';
    echo form_dropdown("class_name", $classRow, $this->input->post("class_name") ? $this->input->post("class_name") : " ");
    echo '</td>';
    echo '</tr>';
    /* =======================end add Teacher name=============== */
    ?>
    <tr>
        <td valign='top'>Date <span>*</span></td>
        <td><input type="text" name="txtdate" class="datepicker" value="<?php echo ($this->input->post("txtdate")) ? $this->input->post("txtdate") : "" ?>" /></td> 

    </tr>
<?php
echo '<tr>';
echo '<td valign="top">Class Time &nbsp;<span>*</span>&nbsp;</td>';
echo '<td>' . form_input(array('name' => 'txtdrop', 'value' => $this->input->post("txtdrop") ? $this->input->post("txtdrop") : " ")) . form_error('txtdrop') . '</td>';
echo '</td>';
echo '</tr>';

echo '<tr>';
echo '<td  width="40%">';
echo '</fieldset>';
echo '<fieldset style=" float:right; margin: 0 auto;width:90%;height: 50px;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
echo '<legend align="center"><div style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 11px;color:#006600;">Card Type</div></legend>';
echo '<div cellspacing:5px;>';
echo form_radio(array('name' => 'card', 'value' => '1')) . '1&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'card', 'value' => '4')) . '4&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'card', 'value' => '1month')) . '1 month&nbsp;&nbsp;&nbsp;<br /><br />';
echo form_radio(array('name' => 'card', 'value' => '10 class')) . '10 Class&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'card', 'value' => '20 class')) . '20 Class&nbsp;&nbsp;&nbsp;';
echo '</div>';
echo '</fieldset>';
echo'</td>';
echo '<td width="40%">';
echo '<fieldset style="float:left; margin: 0 auto;width:97%;height: 50px;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
echo '<legend align="center"><div style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 11px;color:#006600;">Student Type</div></legend>';
echo '<div style="text-align:center;">';
echo form_radio(array('name' => 'student', 'value' => 'V')) . 'V&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'student', 'value' => 'K')) . 'K&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'student', 'value' => 'T')) . 'T&nbsp;&nbsp;&nbsp;';
echo form_radio(array('name' => 'student', 'value' => 'other')) . 'Other&nbsp;&nbsp;&nbsp;<br/><br/>';
echo '</div>';
echo '</td>';
echo '</tr>';

//-------------button submite and button reset--------------------

echo '<tr>';
echo '<td colspan="2" align="center">' . form_submit('btn_submit', 'Add') . form_reset('btn_reset', 'Reset') . '</td>';
echo '</tr>';
echo '</table>';
echo '</fieldset>';
echo '</div>';
echo form_close();
?>
</div>